<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<!-- 添加 -->
<c:if test="${empty method }">
<div class="panel-body"> 
  <form class="form-horizontal" id="productAttrValueMng" action="" method="post">
	      
	  <s:iterator value="#groups">
	      <div class="form-group">
	         <label class="col-sm-offset-5 col-sm-1 control-label" style="text-align: center">${name }</label>
		  </div>
		  
		 <c:forEach items="${productAttrList }" var="attr" >
			  <input type="hidden" name="productAttrValueId" value=""> 
			  
			  <div class="form-group">
				  <label class="col-sm-offset-1 col-sm-2 control-label">属性名称：</label>
				   <div class="col-sm-2">
				       <input class="form-control" type="text" name="productAttrName" readonly="readonly" value="${attr.name }"> 
			           <input type="hidden" name="productAttrId" value="${attr.id }">
				  </div>
				  
				  <label class="col-sm-2 control-label">属性值：</label>
				  <div class="col-sm-2">
				     <input type="text" class="form-control" name="value" placeholder="请输入属性值" value=" "> 
				     <div class="check" style="color:#a94442;font-size:85%"><span class="checkMsg"></span></div>
				  </div>
			  </div>
		 </c:forEach>
		   <hr>
	 </s:iterator>
		  
		
		  <div class="form-group">
			 <div class="col-sm-offset-5 col-sm-7">
			    <input type="button" class="btn btn-default" onclick="submitForm(2)" value="保存">
			    <!-- <input type="button" class="btn btn-default" onclick="nextPage(3)" value="下一步"> -->
			 </div>
		  </div>
	
	</form>
</div>
</c:if>   
    
	  
<c:if test="${!empty method }">
    <!-- 修改 -->
	<c:if test="${param.params =='update'}">
	<div class="panel-body"> 
	  <form class="form-horizontal" id="productAttrValueMng" action="" method="post">
	      
		 <s:iterator value="#groups">
		      <div class="form-group">
		         <label class="col-sm-offset-5 col-sm-1 control-label" style="text-align: center">${name }</label>
			  </div>
			  
			 <c:forEach items="${productAttrList }" var="attr" >
				  <input type="hidden" name="productAttrValueId" value="<s:iterator value='#av'><c:if test='${productAttr.id == attr.id }'>${id }</c:if></s:iterator>"> 
				  
				  <div class="form-group">
					  <label class="col-sm-offset-1 col-sm-2 control-label">属性名称：</label>
					   <div class="col-sm-2">
					       <input class="form-control" type="text" name="productAttrName" readonly="readonly" value="${attr.name }"> 
				           <input type="hidden" name="productAttrId" value="${attr.id }">
					  </div>
					  
					  <label class="col-sm-2 control-label">属性值：</label>
					  <div class="col-sm-2">
					     <input type="text" class="form-control" name="value" value="<s:iterator value='#av'><c:if test='${productAttr.id == attr.id }'>${value }</c:if></s:iterator>"> 
					     <div class="check" style="color:#a94442;font-size:85%"><span class="checkMsg"></span></div>
					  </div>
				  </div>
			 </c:forEach>
			   <hr>
		 </s:iterator>
			
			<div class="form-group">
			  <div class="col-sm-offset-5 col-sm-1" style="text-align: center">
				  <input type="button" class="btn btn-default" onclick="submitForm(2)" value="保存"  style="margin:0 auto">
			   <!-- <input type="button" class="btn btn-default" onclick="nextPage(3)" value="下一步"> -->
			   </div>
			</div>
		
		</form>
	</div>
	</c:if>

    <!-- 查看 -->
	<c:if test="${param.params == 'view'}">
		<div class="panel-body"> 
	  <form class="form-horizontal" id="productAttrValueMng" action="" method="post">
	      
		 <s:iterator value="#groups">
		      <div class="form-group">
		         <label class="col-sm-offset-5 col-sm-1 control-label" style="text-align: center">${name }</label>
			  </div>
			  
			 <c:forEach items="${productAttrList }" var="attr" >
				  
				  <div class="form-group">
					  <label class="col-sm-offset-1 col-sm-2 control-label">属性名称：</label>
					   <div class="col-sm-2">
					       <input class="form-control" type="text" name="productAttrName" readonly="readonly" value="${attr.name }" onchange="checkName('productAttrName')"> 
					  </div>
					  
					  <label class="col-sm-2 control-label">属性值：</label>
					  <div class="col-sm-2">
					     <input type="text" class="form-control" name="value" readonly="readonly" value="<s:iterator value='#av'><c:if test='${productAttr.id == attr.id }'>${value }</c:if></s:iterator>" onchange="checkName('value')"> 
					  </div>
				  </div>
			 </c:forEach>
			   <hr>
		 </s:iterator>
		</form>
	</div>
	</c:if>

</c:if>	  
	  
